package com.lt.eurekaconsumerfeign.service;

import com.lt.dto.UserDto;
import com.lt.vo.ResultEntity;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserServiceFallBack implements FallbackFactory<UserService> {
    @Override
    public UserService create(Throwable throwable) {
       throwable.printStackTrace();
        return new UserService() {
            @Override
            public ResultEntity getUserList(UserDto userDto) {
                return ResultEntity.error("10001","查询列表失败........................");
            }
        };
    }
    /*@Override
    public ResultEntity getUserList(UserDto userDto) {
        return ResultEntity.error("10001","服务器哪去了........................");
    }*/

}
